import { stringify } from 'qs';
import request from '../../common/utils/request';
import { Constants } from '../../common/constant/constants';

//角色管理
export async function updateRole(params) {
    return request(Constants.JAVA_URL+'/sys/role/update', {
        method: 'POST',
        body: params,
    });
}
export async function saveRole(params) {
    return request(Constants.JAVA_URL+'/sys/role/save', {
        method: 'POST',
        body: params,
    });
}

export async function deleteRole(params) {
    return request(Constants.JAVA_URL+'/sys/role/delete', {
        method: 'DELETE',
        body: params,
    });
}

export async function queryRole(params) {
    return request(Constants.JAVA_URL+`/sys/role/list?${stringify(params)}`);
}

export async function queryRoleMenu(params) {
    return request(Constants.JAVA_URL+`/sys/role/info/${params}`);
}

export async function queryAllRole() {
    return request(Constants.JAVA_URL+`/sys/role/select`);
}